Skip to content

Expo plugin: onNewIntent Method Conflict in Android MainActivity#13

Merged
youedd merged 1 commit into
youedd:mainfrom
descorp:patch-1
Oct 19, 2025
Merged

Expo plugin: onNewIntent Method Conflict in Android MainActivity#13
youedd merged 1 commit into
youedd:mainfrom
descorp:patch-1

Conversation

@descorp
Copy link
Copy Markdown
Contributor

@descorp descorp commented Oct 16, 2025

I've encountered a compatibility issue when using this package alongside other libraries that also need to handle new intents in the Android MainActivity.

I would like to suggest a use of a default signature of kotlin method.


For a more robust long-term solution, I suggest modifying the Expo plugin to perform a "soft" modification.:

  1. Check for an existing onNewIntent implementation in MainActivity.kt.
  2. If it exists, inject the necessary PayPal-specific code inside the body of the existing method, preferably after a call to super.onNewIntent(intent).
  3. If it doesn't exist, inject the full override fun onNewIntent(intent: Intent) { ... } method

@youedd youedd merged commit 5691466 into youedd:main Oct 19, 2025
0 of 5 checks passed
@youedd
Copy link
Copy Markdown
Owner

youedd commented Oct 19, 2025

Thank you @descorp for your contribution.

If the onNewIntent method already exists for another purpose, a soft modification could lead to code that compiles but causes runtime issues, either breaking this library or others that rely on the same method.
That kind of conflict would be difficult to detect and debug.

In my opinion, it’s safer for the plugin to fail explicitly in such cases, leaving it to the developer using the package to handle this integration manually.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants